/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.team1662.commands.auto;

 
import edu.wpi.first.wpilibj.team1662.Constants;
import edu.wpi.first.wpilibj.team1662.commands.CommandBase;

/**
 *
 * @author DevBo
 */
public class AutoShoot extends CommandBase {
    
    private boolean done = false;
    
    public AutoShoot() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
        setTimeout(Constants.SHOOT_TIME);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
        drivetrain.cheezit(0);
        done = false;
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        if (client.isInHotzone() || System.currentTimeMillis() > 50000) {
            // TODO: add shoot code
            
            drivetrain.cheezit(1);
            
            //done = true;
        }
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return done;
    }

    // Called once after isFinished returns true
    protected void end() {
        drivetrain.cheezit(0);
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
        drivetrain.cheezit(0);
    }
}
